package cn.zf233.xcloud.commom.enums;

/**
 * Created by zf233 on 2020/1/30
 * 用户更新字段
 */
public enum UserFieldENUM {

    NICKNAME("昵称", 1),
    PASSWORD("密码", 2),
    EMAIL("邮箱", 3),
    PHONE("手机", 4);

    private final String describe;
    private final Integer code;

    public static UserFieldENUM getUserUpdateFieldENUM(Integer code) {
        for (UserFieldENUM value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    UserFieldENUM(String describe, Integer code) {
        this.describe = describe;
        this.code = code;
    }

    public String getDescribe() {
        return describe;
    }

    public Integer getCode() {
        return code;
    }
}